package pos.domain;

import java.sql.Date;
import java.util.List;

public class EventImpl implements Event {

	private String id;
	private String title;
	private String description;
	private List<Entity> listEntities;
	private Category category;
	private Discipline discipline;
//	private String contactPhone;
//	private String bookingPhone;
//	private String faxPhone;
//	private String email;
//	private String price;
//	private String group;
//	private String scope;
//	private String partner;
	private Date date;
//	private Date startDate;
//	private Date endDate;
	private String url;
//	private String location;
	private List<Relation> listRelations;
	private String originalText;
	private String translatedText;

	// private String priceDescription;
	// private boolean soldOutStatus;
	// private boolean cancelStatus;
	// private String target;
	// private String performer;
	// private Event eventLinked;

	public EventImpl() {

	}

	public EventImpl(String id, String title, String description, List<Entity> listEntities,
			Category category, Discipline discipline, Date date, String url, String location, List<Relation> listRelations, String originalText, String translatedText) {
		super();
		this.id = id;
		this.title = title;
		this.description = description;
		this.listEntities = listEntities;
		this.category = category;
		this.discipline = discipline;
		this.date = date;
		this.url = url;
		this.listRelations = listRelations;
		this.originalText = originalText;
		this.translatedText = translatedText;
		
//		this.contactPhone = contactPhone;
//		this.bookingPhone = bookingPhone;
//		this.faxPhone = faxPhone;
//		this.email = email;
//		this.price = price;
//		this.group = group;
//		this.scope = scope;
//		this.partner = partner;
//		this.startDate = startDate;
//		this.endDate = endDate;
//		this.location = location;
	
	}

	public String getId() {
		return id;
	}

	public String getTitle() {
		return title;
	}

	public String getDescription() {
		return description;
	}
	
	public List<Entity> getListEntities() {
		return listEntities;
	}

	public Category getCategory() {
		return category;
	}
	
	public Discipline getDiscipline(){
		return discipline;
	}

//	public String getContactPhone() {
//		return contactPhone;
//	}

//	public String getBookingPhone() {
//		return bookingPhone;
//	}
//
//	public String getFaxPhone() {
//		return faxPhone;
//	}

//	public String getEmail() {
//		return email;
//	}
//
//	public String getPrice() {
//		return price;
//	}

//	public String getGroup() {
//		return group;
//	}
//
//	public String getScope() {
//		return scope;
//	}
//
//	public String getPartner() {
//		return partner;
//	}

	public Date getDate() {
		return date;
	}

//	public Date getStartDate() {
//		return startDate;
//	}
//
//	public Date getEndDate() {
//		return endDate;
//	}

	public String getUrlEvent() {
		return url;
	}

//	public String getLocation() {
//		return location;
//	}
	
	public List<Relation> getListRelations(){
		return listRelations;
	}
	
	public String getOriginalText(){
		return originalText;
	}
	
	public String getTranslatedText(){
		return translatedText;
	}
	
	// Setters

	public void setId(String id) {
		this.id = id;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	public void setEntity(Entity entity){
		this.listEntities.add(entity);
	}
	
	public void setListEntities(List<Entity> listEntities){
		this.listEntities=listEntities;
	}

	public void setCategory(Category category) {
		this.category = category;
	}
	
	public void setDiscipline(Discipline discipline){
		this.discipline = discipline;
	}

//	public void setContactPhone(String contactPhone) {
//		this.contactPhone = contactPhone;
//	}

//	public void setBookingPhone(String bookingPhone) {
//		this.bookingPhone = bookingPhone;
//	}
//
//	public void setFaxPhone(String faxPhone) {
//		this.faxPhone = faxPhone;
//	}

//	public void setEmail(String email) {
//		this.email = email;
//	}
//
//	public void setPrice(String price) {
//		this.price = price;
//	}

//	public void setGroup(String group) {
//		this.group = group;
//	}
//
//	public void setScope(String scope) {
//		this.scope = scope;
//	}
//
//	public void setPartner(String partner) {
//		this.partner = partner;
//	}

	public void setDate(Date date) {
		this.date = date;
	}

//	public void setStartDate(Date startDate) {
//		this.startDate = startDate;
//	}
//
//	public void setEndDate(Date endDate) {
//		this.endDate = endDate;
//	}

	public void setUrlEvent(String url) {
		this.url = url;
	}

//	public void setLocation(String location) {
//		this.location = location;
//	}
	public void setListRelations(List<Relation> listRelations){
		this.listRelations = listRelations;
	}
	
	public void setOriginalText(String originalText){
		this.originalText = originalText;
	}
	
	public void setTranslatedText(String translatedText){
		this.translatedText = translatedText;
	}

	public int hashCode() {
		final int prime = 31;
		int result = 1;
//		result = prime * result
//				+ ((bookingPhone == null) ? 0 : bookingPhone.hashCode());
		result = prime * result
				+ ((category == null) ? 0 : category.hashCode());
		result = prime * result
				+ ((discipline == null) ? 0 : discipline.hashCode());
//		result = prime * result
//				+ ((contactPhone == null) ? 0 : contactPhone.hashCode());
		result = prime * result + ((date == null) ? 0 : date.hashCode());
		result = prime * result
				+ ((description == null) ? 0 : description.hashCode());
//		result = prime * result + ((email == null) ? 0 : email.hashCode());
//		result = prime * result + ((endDate == null) ? 0 : endDate.hashCode());
//		result = prime * result
//				+ ((faxPhone == null) ? 0 : faxPhone.hashCode());
//		result = prime * result + ((group == null) ? 0 : group.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
//		result = prime * result
//				+ ((location == null) ? 0 : location.hashCode());
//		result = prime * result + ((partner == null) ? 0 : partner.hashCode());
//		result = prime * result + ((price == null) ? 0 : price.hashCode());
//		result = prime * result + ((scope == null) ? 0 : scope.hashCode());
//		result = prime * result
//				+ ((startDate == null) ? 0 : startDate.hashCode());
		result = prime * result + ((title == null) ? 0 : title.hashCode());
		result = prime * result + ((url == null) ? 0 : url.hashCode());
		result = prime * result + ((translatedText == null) ? 0 : translatedText.hashCode());
		return result;
	}

	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		EventImpl other = (EventImpl) obj;
//		if (bookingPhone == null) {
//			if (other.bookingPhone != null)
//				return false;
//		} else if (!bookingPhone.equals(other.bookingPhone))
//			return false;
		if (category == null) {
			if (other.category != null)
				return false;
		} else if (!category.equals(other.category))
			return false;
		if (discipline == null) {
			if (other.discipline != null)
				return false;
		} else if (!discipline.equals(other.discipline))
			return false;
//		if (contactPhone == null) {
//			if (other.contactPhone != null)
//				return false;
//		} else if (!contactPhone.equals(other.contactPhone))
//			return false;
		if (date == null) {
			if (other.date != null)
				return false;
		} else if (!date.equals(other.date))
			return false;
		if (description == null) {
			if (other.description != null)
				return false;
		} else if (!description.equals(other.description))
			return false;
//		if (email == null) {
//			if (other.email != null)
//				return false;
//		} else if (!email.equals(other.email))
//			return false;
//		if (endDate == null) {
//			if (other.endDate != null)
//				return false;
//		} else if (!endDate.equals(other.endDate))
//			return false;
//		if (faxPhone == null) {
//			if (other.faxPhone != null)
//				return false;
//		} else if (!faxPhone.equals(other.faxPhone))
//			return false;
//		if (group == null) {
//			if (other.group != null)
//				return false;
//		} else if (!group.equals(other.group))
//			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
//		if (location == null) {
//			if (other.location != null)
//				return false;
//		} else if (!location.equals(other.location))
//			return false;
//		if (partner == null) {
//			if (other.partner != null)
//				return false;
//		} else if (!partner.equals(other.partner))
//			return false;
//		if (price == null) {
//			if (other.price != null)
//				return false;
//		} else if (!price.equals(other.price))
//			return false;
//		if (scope == null) {
//			if (other.scope != null)
//				return false;
//		} else if (!scope.equals(other.scope))
//			return false;
//		if (startDate == null) {
//			if (other.startDate != null)
//				return false;
//		} else if (!startDate.equals(other.startDate))
//			return false;
		if (title == null) {
			if (other.title != null)
				return false;
		} else if (!title.equals(other.title))
			return false;
		if (url == null) {
			if (other.url != null)
				return false;
		} else if (!url.equals(other.url))
			return false;
		return true;
	}

	public String toString() {
		return "EventImpl [id=" + id + ", title=" + title + ", description="
				+ description + ", category=" + category + ", contactPhone="
//				+ contactPhone + ", email=" + email + ", price=" + price
				+ ", date=" + date + ", url=" + url + ", location=" +
						"originalText=" + originalText +
					"]";
	}


}
